<?php
 	// So tthc lay ra duoc
$v_current_style_name = "odd_row";
$v_next_style_name="";
?>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr><td height="10"></td></tr>
	<tr class="page_title">
		<td colspan="2"><?php echo CONST_RESULT_SEARCH_CONDITIONS_LABEL." (".$v_total_af_count.")"; ?></td>
	</tr>
	<tr><td height="10"></td></tr>
</table><?php
if ($v_number_of_af>0){?>
	<table class="list_table" width="100%" cellpadding="0" cellspacing="0">
	<col width="10%"><col width="85%"><col width="5%">		
		<tr class="header">
			<td align="center"><?php echo CONST_AF_ORDER; ?></td>
			<td align="center" colspan="10"><?php echo CONST_AF_NAME_LABEL; ?></td>
		</tr><?php
		$stt=($page-1)*$limit;	
		for($v_index = 0; $v_index < $v_number_of_af ; $v_index++){
			$v_af_code= $arr_all_af[$v_index]['1'];
			$v_af_id = $arr_all_af[$v_index]['0'];
			$v_af_name = $arr_all_af[$v_index]['2'];			
			$v_url = "index.php?fuseaction=DISPLAY_SINGLE_AF&af_id=" . $v_af_id;
						
			if ($v_current_style_name == "odd_row"){
				$v_current_style_name = "round_row";
			}else{
				$v_current_style_name = "odd_row";
			}	
			$stt += 1;	
			?>
			<tr class="<?php echo $v_current_style_name ?>">
				<td align="center" class="normal_label"><?php echo $stt;?></td>
				<td align="left" colspan="10">
					<img src="<?php echo $_ISA_IMAGE_URL_PATH?>doc.gif">
					<a href="<?php echo $v_url;?>"><?php echo $v_af_name;?>&nbsp;</a>
				</td>					
			</tr><?php			 
		}
		if ($v_current_style_name == "odd_row"){
			$v_next_style_name = "round_row";
		}else{
			$v_next_style_name = "odd_row";
		}
		echo _add_empty_row($v_number_of_af,CONST_LIMIT_AF_PAGE,$v_current_style_name,$v_next_style_name,2);?>
	</table>
<?php
}else{
		echo CONST_NO_AF_MESSAGE;
}?>
<table>
	<tr>
		<col width="5%"><col width="95%">
		<td align="center" class="normal_label"><?
			$url ="index.php?fuseaction=DISPLAY_AF_BY_SEARCH_CONDITIONS&method=" .$v_method."&filter=".$v_filter."&agency_id=".$v_agency_id."&cate_id=".$v_cate_id;
			$url .="";
			if ($v_total_af_count > $v_limit) {//(*)
				if ($page == 1)  
					echo "<img src=" . $_ISA_IMAGE_URL_PATH . "d-arrow-left.jpg class=normal_image align=center>"; 
				else            
					echo "<a href=\"".$url."&page=".($page - 1). "\">". "<img src=" . $_ISA_IMAGE_URL_PATH . "arrow-left.jpg class=normal_image align=center>" . "</a>";
				for ($i = 1; $i <= $pager->numPages; $i++) { 
					echo " | "; 
					if ($i == $pager->page)
						echo $i; 
					else 
						 echo "<a href=\"".$url."&page=". $i. "\">". $i."</a>";
					}//end for
				if ($page == $pager->numPages) 
					echo " | ". "<img src=" . $_ISA_IMAGE_URL_PATH . "d-arrow-right.jpg class=normal_image align=center>"; 
				else            
					echo " | ". "<a href=\"".$url."&page=".($page + 1) . "\">" . "<img src=" . $_ISA_IMAGE_URL_PATH . "arrow-right.jpg class=normal_image align=center>" . "</a>";
			} //end if?>
			</b>
		</td>
	</tr>
</table>